package valueObjects
{
	import mx.messaging.channels.StreamingAMFChannel;
	
	[Bindable]
	public class Product
	{
		public var provider:String;	//货物提供商
		public var timeIn:Date;		//进货时间
		public var type:String;		//所属类型
		public var fun:String;		//功能
		public var prodID:String;
		public var prodName:String;
		public var producer:String;
		public var priceOfOrigin:Number;	//进货价
		public var priceOfTrade:Number;		//批发价
		public var priceOfRetail:Number;	//零售价
		public var descrition:String;   //规格
		
		public function Product(_timeIn:Date,_type:String,_fun:String,_prodID:String,_prodName:String,_producer:String,
								_priceOfOrigin:Number,_priceOfTrade:Number,_priceOfRetail:Number,_descrition:Number)
		{
			timeIn = _timeIn;
			type = _type;
			fun = _fun;
			prodID = _prodID;
			prodName = _prodName;
			producer = _producer;
			priceOfOrigin = _priceOfOrigin;
			priceOfTrade = _priceOfTrade;
			priceOfRetail = _priceOfRetail;
			descrition = _descrition;
		}
		
		public function toString():String
		{
			return "[Product]"+this.prodName;
		}
		
		public static function buildProduct(o:Object):Product
		{
			var p:Product = new Product(o.timeIn,o.type,o.fun,o.prodID,o.prodName,
				o.producer,o.priceOfOrigin,o.priceOfTrade,o.priceOfRetail,o.descrition);
			return p;
		}

	}
}